export function joinArray(arg) {
  var a
  if (!arg) {
    return null
  }
  if (arg.length > 1) {
    a = arg.join(',')
  } else {
    a = arg[0]
  }
  return a
}

export function checkDisabled(item, contrast) {
  let flag = false
  contrast.forEach(e => {
    if (e.some(a => {
      const checkObj = JSON.parse(a)
      return checkObj.dataAttrId === item.dataAttrId && checkObj.targetType === item.targetType
    })) flag = true
  })
  return flag
}
